package com.zerox.service.impl;

import com.zerox.mapper.SupplierMapper;
import com.zerox.pojo.Supplier;
import com.zerox.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService {
    @Autowired
    private SupplierMapper mapper;


    @Override
    public List<Supplier> list(Integer pageNo, Integer limit, String supName) {
        Integer index=(pageNo-1)*limit;
        return mapper.getSupplierList(index,limit,supName);
    }

    @Override
    public int count(String supName) {
        return mapper.count(supName);
    }

    @Override
    public int add(Supplier supplier) {
        return mapper.add(supplier);
    }

    @Override
    public Supplier selectId(Integer id) {
        return mapper.selectId(id);
    }

    @Override
    public int del(Integer id) {
        return mapper.del(id);
    }

    @Override
    public int update(Supplier supplier) {
        return mapper.update(supplier);
    }

    @Override
    public int selectBysupCode(String supCode) {
        return mapper.selectBysupCode(supCode);
    }
}
